﻿@model DMS.BO.Models.HotelViewModel
@using DMS.BO.Web.Ajax
@using DMS.BO.Web.Mvc
@{
    ViewBag.Title = "Hotels Management";
}

<div class="ad_title_bg">
    <div class="ad_title_page">Quản lý khách sạn</div>
</div>
<!--content-->
@using (Ajax.BeginForm("Index", "Hotel", FormMethod.Post, new BOAjaxOptions { UpdateTargetId = "Hotelresult" }, new { @id = "frmHotel" }))
{  
    <table class="ad_content" width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="180" class="col_odd">
                <fieldset style="width: 180px; float: left;">

                    <legend>Tìm kiếm theo</legend>
                    <div class="row">
                        <input type="submit" value="Tìm kiếm" class="btn_sumit" style="width: 170px;" />
                    </div>
                    <div class="ad_form">
                        @Html.Hidden("PageIndex")
                        <span class="form_title">Tên khách sạn</span>
                        <div class="row">
                            @Html.TextBoxFor(m => m.Name, new { @style = "width: 160px;" })
                        </div>
                        <span class="form_title">Mã thành phố</span>
                        <div class="row">
                            @Html.DropDownListFor(m => m.CityID, (List<SelectListItem>)ViewBag.listCity, new { @style = "width: 160px;" })
                        </div>
                        <span class="form_title">Trạng thái</span>
                        <div class="row">
                            @Html.EnumDropDownList("Status", null, typeof(DMS.Entities.HotelStatus), true, "", new { @style = "width: 160px;" }, "")
                        </div>
                        <div class="row">
                            <input type="submit" value="Tìm kiếm" class="btn_sumit" style="width: 170px;" />
                        </div>
                        <br class="clean" />
                    </div>

                </fieldset>
            </td>
            <td valign="top" class="col_even">
                <div id="Hotelresult">
                </div>
            </td>
        </tr>

    </table>
}
<div id="dialog-form" title="Sửa thông tin khách sạn">
</div>
<script type="text/javascript">
    dialog = $("#dialog-form").dialog({
        autoOpen: false,
        height: 300,
        width: 350,
        modal: true
    });
    
</script>
<script>

    function editHotelDialog(id) {
        /* Get hotel by id  and set value to form */
        var formData = { ID: id };
        $.ajax({
            url: "/Hotel/GetHotelByID",
            data: formData,
            type: "post",
            success: function (returnData) {
                $("#dialog-form").html(returnData);
            }
        });

        /* end */       
        /* Open dialog */
        dialog.dialog("open");
        /* end */
    }

    
</script>

<script type="text/javascript">
    $(".btn_sumit").click(function () {
        $('#PageIndex').val("1");
    });

</script>



